home *** CD-ROM | disk | FTP | other *** search
/ Programming in Microsoft Windows with C# / Programacion en Microsoft Windows con C#.iso / Original Code / Hello Windows Forms / SeparateMain / SeparateMain.cs next >
Encoding:
Text File  |  2001-01-15  |  694 b   |  28 lines

  1. //-------------------------------------------
  2. // SeparateMain.cs ⌐ 2001 by Charles Petzold
  3. //-------------------------------------------
  4. using System;
  5. using System.Drawing;
  6. using System.Windows.Forms;
  7.  
  8. class SeparateMain
  9. {
  10.      public static void Main()
  11.      {
  12.           Application.Run(new AnotherHelloWorld());
  13.      }
  14. }
  15. class AnotherHelloWorld: Form
  16. {
  17.      public AnotherHelloWorld()
  18.      {
  19.           Text = "Another Hello World";
  20.           BackColor = Color.White;
  21.      }
  22.      protected override void OnPaint(PaintEventArgs pea)
  23.      {
  24.           Graphics grfx = pea.Graphics;
  25.  
  26.           grfx.DrawString("Hello, Windows Forms!", Font, Brushes.Black, 0, 0);
  27.      }
  28. }